HTMLify

contact us.html
Views: 279 | Author: sachinthakur
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Contact Us - I-tech computer education centre</title>
    
</head>
<body>
    <header>
        <h1>Contact Us<br>
        I-TECH COMPUTER EDUCATION CENTRE</h1>
        <p>Bamrauli Katara Agra </p>
    </header>

    <section>
        <form id="contactForm">
            <label for="name">Name:</label>
            <input type="text" id="name" name="name" required>

            <label for="email">Email:</label>
            <input type="email" id="email" name="email" required>

            <label for="mobile">mobile </label>

            <input type="mobile" id="mobile" name="mobile" required>

            <label for="message">Message:</label>
            <textarea id="message" name="message" rows="4" required></textarea>

            <button type="button" onclick="submitForm()">Submit</button>
        </form>
    </section>

    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
            background-image: url("https://images.unsplash.com/photo-1571857089849-f6390447191a?w=500&auto=format&fit=crop&q=60&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8MTF8fGNvbXB1dGVyJTIwY2xhc3N8ZW58MHx8MHx8fDA%3D") 
        }

        header {
            background-color: #536298;
            color: #fff;
            text-align: center;
            padding: 1em 0;
        }

        section {
            max-width: 600px;
            margin: 20px auto;
            padding: 20px;
            background-color: #04ff6c;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        }

        form {
            display: grid;
            gap: 15px;
        }

        label {
            font-weight: bold;
        }

        input, textarea {
            width: 100%;
            padding: 10px;
            box-sizing: border-box;
        }

        button {
            background-color: #1e879c;
            color: #fff;
            border: none;
            padding: 10px 20px;
            cursor: pointer;
        }

        button:hover {
            background-color: #ef0c0c;
        }
    </style>
    
    <script>
        function submitForm() {
        
            var name = document.getElementById("name").value;
            var email = document.getElementById("email").value;
            var message = document.getElementById("message").value;

            if (name === "" || email === "" || message === "") {
                alert("Please fill in all fields.");
            } else {
                alert("Form submitted!\n\nName: " + name + "\nEmail: " + email + "\nMessage: " + message);
                document.getElementById("contactForm").reset();
            }
        }
    </script>


</body>
</html>

Comments